package com.qzl.feiq.message;

import com.qzl.feiq.enu.MessageTypeEnum;
import lombok.Data;

import java.util.List;

@Data
public class Message {
    // 版本
    private int version;
    // 数据包编号
    private int packetNo;
    // 登录名
    private String senderName;
    // 主机名
    private String senderHost;
    // 命令
    private int command;
    // 附加数据 消息或者文件
    private String msg;

    // 原始数据
    private String rawData;


    // 要接收的ip
    private String toUserIp;
    private String fromUserIp;
    // 发送类型
    private MessageTypeEnum messageType;
    // 附加文件数据
    private List<AdditionalSection> additionalSections;

    public Message(){}
    public Message(String toUserIp, MessageTypeEnum messageType, int command){
        this.toUserIp = toUserIp;
        this.messageType = messageType;
        this.command = command;
    }
    public Message(String toUserIp, int command){
        this.toUserIp = toUserIp;
        this.messageType = MessageTypeEnum.message;
        this.command = command;
    }
}
